home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / present_.swf / scripts / frame_35 / DoAction.as
Encoding:
Text File  |  2011-03-26  |  2.9 KB  |  84 lines

  1. function onReplyList(success)
  2. {
  3.    switch(replyListServer.status)
  4.    {
  5.       case 0:
  6.          msg = "No error; parse was completed successfully.";
  7.          break;
  8.       case -2:
  9.          msg = "A CDATA section was not properly terminated.";
  10.          break;
  11.       case -3:
  12.          msg = "The XML declaration was not properly terminated.";
  13.          break;
  14.       case -4:
  15.          msg = "The DOCTYPE declaration was not properly terminated.";
  16.          break;
  17.       case -5:
  18.          msg = "A comment was not properly terminated.";
  19.          break;
  20.       case -6:
  21.          msg = "An XML element was malformed.";
  22.          break;
  23.       case -7:
  24.          msg = "Out of memory.";
  25.          break;
  26.       case -8:
  27.          msg = "An attribute value was not properly terminated.";
  28.          break;
  29.       case -9:
  30.          msg = "A start-tag was not matched with an end-tag.";
  31.          break;
  32.       case -10:
  33.          msg = "An end-tag was encountered without a matching start-tag";
  34.    }
  35.    replyRoot = replyListServer.firstChild;
  36.    rowNum = replyRoot.childNodes.length;
  37.    if(success)
  38.    {
  39.       var _loc1_ = 0;
  40.       while(_loc1_ < rowNum)
  41.       {
  42.          score = Number(replyRoot.childNodes[_loc1_].attributes.score);
  43.          var _loc3_ = String(Math.floor(score / 6000));
  44.          _loc3_ = _loc3_.length != 1 ? _loc3_ : (_loc3_ = "0" + _loc3_);
  45.          var _loc4_ = String(Math.floor(score / 100) % 60);
  46.          _loc4_ = _loc4_.length != 1 ? _loc4_ : (_loc4_ = "0" + _loc4_);
  47.          var _loc2_ = String(score % 100);
  48.          _loc2_ = _loc2_.length != 1 ? _loc2_ : (_loc2_ = "0" + _loc2_);
  49.          time = _loc3_ + ":" + _loc4_ + ":" + _loc2_;
  50.          topPane.content.attachMovie("dataRow","row" + _loc1_,_loc1_ + 1,{_y:_loc1_ * 19,_x:0,rank:_loc1_ + 1 + ".",nev:replyRoot.childNodes[_loc1_].attributes.name,ido:time});
  51.          _loc1_ = _loc1_ + 1;
  52.       }
  53.       topPane.invalidate();
  54.    }
  55.    else
  56.    {
  57.       trace("------hiba az XML betoltesenel!");
  58.    }
  59. }
  60. function getList(clientid, password)
  61. {
  62.    listServer = new XML();
  63.    listServer.xmlDecl = " <?xml version=\'1.0\' encoding=\'UTF-8\' ?>";
  64.    listServerElement = listServer.createElement("ask");
  65.    listServer.appendChild(listServerElement);
  66.    listElement = listServer.createElement("data");
  67.    listElement.attributes.action = "get_highscore";
  68.    listServerElement.appendChild(listElement);
  69.    listServer.sendAndLoad("processor.php",replyListServer);
  70. }
  71. topPane.setStyle("borderStyle","none");
  72. topPane.setStyle("borderColor",80997);
  73. topPane.setStyle("borderCapColor",80997);
  74. topPane.setStyle("buttonColor",80997);
  75. topPane.setStyle("borderHighlight",96205);
  76. topPane.setStyle("borderShadow",80997);
  77. topPane.setStyle("buttonColor",80997);
  78. system.useCodePage = false;
  79. replyListServer = new XML();
  80. replyListServer.ignoreWhite = true;
  81. replyListServer.onLoad = onReplyList;
  82. getList();
  83. stop();
  84.